<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('云游展厅管理')" />
    <style>
        .exhibition-card {
            margin-bottom: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }
        .exhibition-card:hover {
            box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
            transform: translateY(-2px);
        }
        .exhibition-card .card-header {
            padding: 15px 20px;
            border-bottom: 1px solid #e8e8e8;
            font-weight: bold;
        }
        .exhibition-card .card-body {
            padding: 20px;
        }
        .exhibition-item {
            padding: 15px 0;
            border-bottom: 1px solid #f0f0f0;
        }
        .exhibition-item:last-child {
            border-bottom: none;
        }
        .exhibition-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        .exhibition-info {
            color: #666;
            font-size: 14px;
            margin-bottom: 8px;
        }
        .exhibition-description {
            margin: 10px 0;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 4px;
        }
        .exhibition-actions {
            margin-top: 10px;
        }
        .btn-exhibition {
            margin-right: 10px;
        }
        .exhibition-image {
            max-width: 100%;
            max-height: 200px;
            margin: 10px 0;
        }
        .vr-video-list {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-top: 15px;
        }
        .vr-video-item {
            flex: 1 1 calc(33.333% - 15px);
            min-width: 250px;
            border: 1px solid #e8e8e8;
            border-radius: 8px;
            padding: 15px;
            background: #fafafa;
            transition: all 0.3s ease;
        }
        .vr-video-item:hover {
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            transform: translateY(-2px);
        }
        .vr-video-title {
            font-weight: bold;
            margin-bottom: 10px;
            font-size: 16px;
        }
        .vr-video-thumbnail {
            width: 100%;
            height: 150px;
            background: linear-gradient(45deg, #f0f2f5, #e4e7ed);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 15px;
            border-radius: 4px;
            position: relative;
            overflow: hidden;
        }
        .vr-video-thumbnail::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23409EFF"><path d="M8 5v14l11-7z"/></svg>') no-repeat center center;
            background-size: 40px;
            opacity: 0.7;
        }
        .vr-video-actions {
            text-align: center;
        }
        .btn-play {
            background-color: #409EFF;
            color: white;
            border: none;
            padding: 8px 20px;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            transition: background-color 0.3s;
        }
        .btn-play:hover {
            background-color: #337ecc;
        }
        .video-meta {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: #888;
            margin-top: 10px;
        }
        .video-summary {
            font-size: 13px;
            color: #666;
            margin: 10px 0;
            line-height: 1.5;
        }
    </style>
</head>
<body class="gray-bg">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>云游展厅内容管理</h5>
                        <div class="ibox-tools">
                            <button type="button" class="btn btn-primary btn-sm" onclick="addExhibition()">
                                <i class="fa fa-plus"></i> 添加展厅内容
                            </button>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="exhibition-card">
                            <div class="card-header bg-success text-white">
                                <i class="fa fa-film"></i> VR视频展厅
                            </div>
                            <div class="card-body">
                                <div class="exhibition-item">
                                    <div class="exhibition-title">长征VR视频</div>
                                    <div class="exhibition-info">
                                        <span>类型：VR视频</span> |
                                        <span>创建时间：2023-06-01</span> |
                                        <span>状态：<span class="label label-primary">已发布</span></span>
                                    </div>
                                    <div class="exhibition-description">
                                        通过VR技术重现红军长征的艰辛历程，包括重要战役、历史事件等场景。
                                    </div>
                                    <div class="vr-video-list">
                                        <div class="vr-video-item">
                                            <div class="vr-video-title">长征出发</div>
                                            <div class="vr-video-thumbnail"></div>
                                            <div class="video-summary">
                                                记录了红军长征出发时的历史场景...
                                            </div>
                                            <div class="vr-video-actions">
                                                <button class="btn-play" onclick="playVRVideo('changzheng_start.mp4')">
                                                    <i class="fa fa-play"></i> 播放
                                                </button>
                                            </div>
                                            <div class="video-meta">
                                                <span>上传人：张三</span>
                                                <span>时长：5:20</span>
                                            </div>
                                        </div>
                                        <div class="vr-video-item">
                                            <div class="vr-video-title">遵义会议</div>
                                            <div class="vr-video-thumbnail"></div>
                                            <div class="video-summary">
                                                再现了遵义会议这一重要历史时刻...
                                            </div>
                                            <div class="vr-video-actions">
                                                <button class="btn-play" onclick="playVRVideo('zunyi_meeting.mp4')">
                                                    <i class="fa fa-play"></i> 播放
                                                </button>
                                            </div>
                                            <div class="video-meta">
                                                <span>上传人：李四</span>
                                                <span>时长：8:15</span>
                                            </div>
                                        </div>
                                        <div class="vr-video-item">
                                            <div class="vr-video-title">过雪山</div>
                                            <div class="vr-video-thumbnail"></div>
                                            <div class="video-summary">
                                                展示了红军翻越雪山的艰难历程...
                                            </div>
                                            <div class="vr-video-actions">
                                                <button class="btn-play" onclick="playVRVideo('cross_snow_mountain.mp4')">
                                                    <i class="fa fa-play"></i> 播放
                                                </button>
                                            </div>
                                            <div class="video-meta">
                                                <span>上传人：王五</span>
                                                <span>时长：6:40</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="exhibition-actions">
                                        <button class="btn btn-success btn-exhibition btn-sm" onclick="editExhibition(1)">
                                            <i class="fa fa-edit"></i> 编辑
                                        </button>
                                        <button class="btn btn-danger btn-exhibition btn-sm" onclick="deleteExhibition(1)">
                                            <i class="fa fa-trash"></i> 删除
                                        </button>
                                    </div>
                                </div>
                                
                                <div class="exhibition-item">
                                    <div class="exhibition-title">建党建国VR视频</div>
                                    <div class="exhibition-info">
                                        <span>类型：VR视频</span> |
                                        <span>创建时间：2023-06-10</span> |
                                        <span>状态：<span class="label label-primary">已发布</span></span>
                                    </div>
                                    <div class="exhibition-description">
                                        通过VR技术展示中国共产党建党及中华人民共和国建国的重要历史时刻。
                                    </div>
                                    <div class="vr-video-list">
                                        <div class="vr-video-item">
                                            <div class="vr-video-title">中共一大</div>
                                            <div class="vr-video-thumbnail"></div>
                                            <div class="video-summary">
                                                再现了中国共产党第一次全国代表大会...
                                            </div>
                                            <div class="vr-video-actions">
                                                <button class="btn-play" onclick="playVRVideo('first_party_congress.mp4')">
                                                    <i class="fa fa-play"></i> 播放
                                                </button>
                                            </div>
                                            <div class="video-meta">
                                                <span>上传人：赵六</span>
                                                <span>时长：10:30</span>
                                            </div>
                                        </div>
                                        <div class="vr-video-item">
                                            <div class="vr-video-title">开国大典</div>
                                            <div class="vr-video-thumbnail"></div>
                                            <div class="video-summary">
                                                重现了1949年10月1日开国大典的盛况...
                                            </div>
                                            <div class="vr-video-actions">
                                                <button class="btn-play" onclick="playVRVideo('founding_ceremony.mp4')">
                                                    <i class="fa fa-play"></i> 播放
                                                </button>
                                            </div>
                                            <div class="video-meta">
                                                <span>上传人：孙七</span>
                                                <span>时长：15:20</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="exhibition-actions">
                                        <button class="btn btn-success btn-exhibition btn-sm" onclick="editExhibition(2)">
                                            <i class="fa fa-edit"></i> 编辑
                                        </button>
                                        <button class="btn btn-danger btn-exhibition btn-sm" onclick="deleteExhibition(2)">
                                            <i class="fa fa-trash"></i> 删除
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- VR视频播放模态框 -->
    <div id="vrVideoModal" class="modal fade" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">VR视频播放</h4>
                </div>
                <div class="modal-body">
                    <video id="vrVideoPlayer" width="100%" height="400" controls>
                        您的浏览器不支持视频播放。
                    </video>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
    
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        // 添加展厅内容
        function addExhibition() {
            $.modal.open("添加展厅内容", ctx + "hui/interact/exhibition/add");
        }
        
        // 编辑展厅内容
        function editExhibition(id) {
            $.modal.open("编辑展厅内容", ctx + "hui/interact/exhibition/edit/" + id);
        }
        
        // 删除展厅内容
        function deleteExhibition(id) {
            $.modal.confirm("确定要删除该展厅内容吗？", function() {
                $.operate.post(ctx + "hui/interact/exhibition/remove/" + id, {}, function(result) {
                    if (result.code == web_status.SUCCESS) {
                        $.modal.msgSuccess("删除成功");
                        // 刷新页面
                        location.reload();
                    } else {
                        $.modal.msgError(result.msg);
                    }
                });
            });
        }
        
        // 播放VR视频
        function playVRVideo(filename) {
            var videoSrc = '/profile/videos/vr/' + filename;
            $('#vrVideoPlayer').attr('src', videoSrc);
            $('#vrVideoModal').modal('show');
        }
    </script>
</body>
</html>